package com.zyh.service;

import com.zyh.dao.BookMapper;
import com.zyh.util.XmlRequest;
import org.springframework.stereotype.Service;

/**
 * @author shihan
 * @date 2020-12-02-9:37
 */
@Service
public class SelectTradeBillsServiceImpl implements  TradeService{
    //调用dao层的操作，设置一个set接口，方便Spring管理
    private BookMapper bookMapper;
    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    //查询交易流程  发送HTTP请求
    public String tradeBills(XmlRequest xmlr) {

        String url = "http://localhost:8081/CheckSystems/Test";


        xmlr.getId();

        System.out.println("地址已发送");
        return "";
        /*
        HttpClient httpclient = null;
        PostMethod post = null;
        String info = "";
        Map<String, Object> mres = new HashMap<String, Object>();

        try {
            httpclient = new HttpClient();
            post = new PostMethod(url);
            post.getParams().setParameter("http.protocol.content-charset", "utf-8");
            String sendMsg = DESDZFP.encrypt(JsonUtils.toJson(order));
            post.addParameter("order", sendMsg);
            httpclient.executeMethod(post);
            info = new String(post.getResponseBody(), "utf-8");
            mres = JsonUtils.toMap(info);
        } catch (Exception e) {
            log.error("发送请求失败：url=" + url, e);
            mres.put("status", "9999");
            mres.put("message", "请求处理异常" + e.getMessage());
        } finally {
            post.releaseConnection();
        }

        return mres;
*/
    }

    //处理业务逻辑




}
